<?php

	// ����������� �������� �������������� ����

	print '<ul class="navigation">' . PHP_EOL;

	foreach ($this->container as $page) {
		
		$active = $page->isActive() ? ' class="active"' : '';
		
	    print '<li'.$active.'><a href="'.$page->getHref().'"'.$active.'>' . $page->getLabel() . '</a>' . PHP_EOL;
	    
	    if(count($page)>0) {
	    	
	    	$middle = ceil(count($page)/2)+1;
	    	
	    	$m = 1;
	    	
	    	print '<ul><span><span><span>' . PHP_EOL;
	    	
		    foreach ($page as $subpage) {
		    	
		    	if(count($page)>4 && $m==$middle) print '</div>' . PHP_EOL;
		    	if(count($page)>4 && ($m==1 || $m==$middle)) print '<div class="flo">' . PHP_EOL;
		    	
		    	$active = $subpage->isActive() ? ' class="active"' : '';
		    	
		    	print '<li'.$active.'>' . $this->navigation()->menu()->htmlify($subpage) . '</li>' . PHP_EOL;
		    	
		    	$m++;
		    	
		    }
		    
		    if(count($page)>4) print '</div>' . PHP_EOL;
		    
		    print '<div class="clear"></div></span></span></span></ul>' . PHP_EOL;
		    
	    }

	    print '</li>' . PHP_EOL;
	}
	
	print '</ul>';
